<!DOCTYPE html>
<html class=" js csstransforms3d" lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.thymeleaf.org/thymeleaf-extras-shiro">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>用户反馈</title>

    <link rel="stylesheet" th:href="@{~/static/css/base.css}" href="../static/css/base.css">
    <link rel="stylesheet" th:href="@{~/static/css/page.css}" href="../static/css/page.css">
    <script type="text/javascript" th:src="@{~/static/js/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{~/static/js/modernizr.js}"></script>
    <script type="text/javascript" th:href="@{~/static/js/jquery-3.3.1.min.js}"
            src="../static/js/jquery-3.3.1.min.js"></script>
    <style>


        .wrap {
            width: 200px;
            height: 80px;
            overflow: hidden!important;
            text-overflow: ellipsis!important;
            display: -webkit-box!important;
            -webkit-line-clamp: 2!important;
            -webkit-box-orient: vertical!important;
            line-height: 25px;
        }
    </style>
</head>
<script>
    UrlParm = function() { // url参数
        var data, index;
        (function init() {
            data = [];
            index = {};
            var u = window.location.search.substr(1);
            if (u != '') {
                var parms = decodeURIComponent(u).split('&');
                for (var i = 0, len = parms.length; i < len; i++) {
                    if (parms[i] != '') {
                        var p = parms[i].split("=");
                        if (p.length == 1 || (p.length == 2 && p[1] == '')) { // p | p=
                            data.push(['']);
                            index[p[0]] = data.length - 1;
                        } else if (typeof(p[0]) == 'undefined' || p[0] == '') { // =c | =
                            data[0] = [p[1]];
                        } else if (typeof(index[p[0]]) == 'undefined') { // c=aaa
                            data.push([p[1]]);
                            index[p[0]] = data.length - 1;
                        } else { // c=aaa
                            data[index[p[0]]].push(p[1]);
                        }
                    }
                }
            }
        })();
        return {
            parm: function(o) { // o: 参数名或者参数次序
                try {
                    return (typeof(o) == 'number' ? data[o][0] : data[index[o]][0]);
                } catch (e) {}
            },
            parmValues: function(o) { //  o: 参数名或者参数次序
                try {
                    return (typeof(o) == 'number' ? data[o] : data[index[o]]);
                } catch (e) {}
            },
            hasParm: function(parmName) {
                return typeof(parmName) == 'string' ? typeof(index[parmName]) != 'undefined' : false;
            },
            parmMap: function() {
                var map = {};
                try {
                    for (var p in index) {
                        map[p] = data[index[p]];
                    }
                } catch (e) {}
                return map;
            }
        }
    }();
</script>
<script>
    $(function () {
        var page= UrlParm.parm("page")
        $.ajax({
            url: "http://localhost/userReleaseList/limit/"+page,
            // url: "https://www.sixstarone.xyz/userReleaseList/limit/0/10",

            type: "GET",
            datatype: "jsonp",
            header: {
                'Content-Type': 'application/json'
            },
            async: false,
            success: function (res) {
                resultList=JSON.parse(res.result)
                if (resultList.length > 0) {
                    var listResult = "";
                    var pageResult="";
                    var pageResultPre = "";
                    var pageResultLast = "";
                    var pageCount=res.page.pageCount;
                    $("#pageSelectList").empty().append(`<span>共 <b>${res.page.listCount}</b> 条</span>`)
                    for (var i = 0; i < resultList.length; i++) {
                        listResult += `<tr >
                                <th class="t_1">${resultList[i].scenic_release_id}</th>
                                <th class="t_1">${resultList[i].scenic_release_title}</th>
                                <th class="wrap" style="padding: 0px 20px;">${resultList[i].scenic_release_text}</th>
                                <th class="t_5">${resultList[i].space_release_time}</th>
                                <th class="t_5">${resultList[i].scenic_name}</th>
                                <th class="t_5">${resultList[i].user_name}</th>
                            <td class="t_4">
                                <div class="btn"><a href="delect.html?id=${resultList[i].scenic_release_id}&&method=delectUserRelease" class="delete">删除</a>
                                </div>
                            </td>
                        </tr>`
                    }
                    $("#list").empty().append(listResult)
                    pageResultPre = ` <div class="pageSelect" id="pageSelect">
                        <div id="pageSelectList">
                        </div>
                        <div class="pageWrap">
                            <a class="pagePre"><i class="ico-pre">&nbsp;</i></a>`
                    pageResultLast = `<a href="#" class="pagenext"><i class="ico-next">&nbsp;</i></a>
                        </div>
                    </div>`
                    for (var i = 0; i < pageCount; i++) {

                        if (page==i+1){
                            pageResultItem=`<a href = "scenic_release_info.html?page=${i+1}" class = "pagenumb cur">${i+1}</a>`
                        }else {
                            pageResultItem=`<a href = "scenic_release_info.html?page=${i+1}" class = "pagenumb">${i+1}</a>`
                        }
                        pageResult+=pageResultItem
                    }
                    $("#pageSelectList").append(pageResultPre+pageResult+pageResultLast)
                }
            }
        })
    })
</script>
<body style="background: #f6f5fa;">
<!--content S-->
<div class="super-content RightMain" id="RightMain">
    <!--header-->
    <div class="superCtab">
        <div class="ctab-title clearfix"><h3>景点发布信息列表</h3>
        </div>
        <div class="ctab-Main">
            <div class="ctab-Main-title">
                <ul class="clearfix">
                    <li><a href="comment_list.html?page=1">用户评论列表</a></li>
                    <li><a href="scenic_info.html?page=1">景点列表</a></li>
                    <li class="cur"><a href="scenic_release_info.html?page=1">景点发布信息列表</a></li>

                </ul>
            </div>
            <div class="ctab-Mian-cont">
                <div class="Mian-cont-btn clearfix">


                </div>
                <div class="Mian-cont-wrap">
                    <div class="defaultTab-T">
                        <table border="0" cellspacing="0" cellpadding="0" class="defaultTable">
                            <tbody>
                            <tr>
                                <th class="t_1">发布id</th>
                                <th class="t_1">标题</th>
                                <th  style="width: 200px;display: flex;justify-content: center;align-items: center;text-align: center;">发布信息</th>
                                <th class="t_5"style="padding-left:60px;">发布时间</th>
                                <th class="t_5"style="padding-left:40px;">景点名称</th>
                                <th class="t_5"style="padding-left:40px;">用户名</th>
                                <th class="t_4">操作</th>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <table border="0" cellspacing="0" cellpadding="0" class="defaultTable defaultTable2">
                        <tbody id="list">

                        </tbody>
                    </table>
                    <!--pages S-->
                    <div class="pageSelect" id="pageSelect">
                        <div id="pageSelectList">
                        </div>
                        <div className="pageWrap" id="pageWrap">
                            <a className="pagePre"><i className="ico-pre">&nbsp;</i></a>
                            <div id="pageIndex">
                            </div>
                            <a href="#" className="pagenext"><i className="ico-next">&nbsp;</i></a>
                        </div>
                    </div>
                    <!--pages E-->
                </div>

            </div>
        </div>
    </div>
    <!--main-->

</div>
<!--content E-->

<div class="layuiBg"></div><!--公共遮罩-->
<!--点击修改弹出层-->
<div class="imgXgbox layuiBox">
    <div class="layer-title clearfix"><h2>修改栏目图片</h2><span class="layerClose"></span></div>
    <div class="layer-content">
        <div class="XgfileImg"><img src="../static/images/bg_img_sc.jpg"><input id="fileImage" class="fileImageSlect"
                                                                                type="file" size="30"
                                                                                name="fileselect[]"></div>
        <p class="onclktip">（点击图片可重新上传）</p>
        <div class="Xgimglink clearfix"><span>图片链接：</span><input type="text" value=""></div>
        <div class="XgBtn"><input type="button" value="保存" class="saveBtn"></div>
    </div>
</div>
<!--点击添加分类弹出-->
<div class="addFeileibox layuiBox">
    <div class="layer-title clearfix"><h2>添加分类</h2><span class="layerClose"></span></div>
    <div class="layer-content">
        <div class="aFllink clearfix"><span>上级栏目：</span><h5>新闻动态</h5></div>
        <div class="aFllink clearfix"><span>二级栏目：</span><input type="text" value=""></div>
        <div class="aFlBtn"><input type="button" value="保存" class="saveBtn"></div>
    </div>
</div>

<!--栏目管理－修改-->
<div class="ColumnXgbox layuiBox">
    <div class="layer-title clearfix"><h2>添加分类</h2><span class="layerClose"></span></div>
    <div class="layer-content">
        <div class="aFllink clearfix"><span>修改名称：</span><input type="text" value=""></div>
        <div class="aFllink clearfix"><span>英文名称：</span><input type="text" value=""></div>
        <div class="aFlBtn"><input type="button" value="保存" class="saveBtn"></div>
    </div>
</div>

<script type="text/javascript" th:src="@{~/static/js/zxxFile.js}"></script>
<script>
    var params = {
        fileInput: $("#fileImage").get(0),
        upButton: $("#fileSubmit").get(0),
        url: $("#uploadForm").attr("action"),
        filter: function (files) {
            var arrFiles = [];
            for (var i = 0, file; file = files[i]; i++) {
                if (file.type.indexOf("image") == 0) {
                    if (file.size >= 512000) {
                        alert('您这张"' + file.name + '"图片大小过大，应小于500k');
                    } else {
                        arrFiles.push(file);
                    }
                } else {
                    alert('文件"' + file.name + '"不是图片。');
                }
            }
            return arrFiles;
        },
        onSelect: function (files) {
            var html = '', i = 0;
            $("#preview").html('<div class="upload_loading"></div>');
            var funAppendImage = function () {
                file = files[i];
                if (file) {
                    var reader = new FileReader()
                    reader.onload = function (e) {
                        $('.XgfileImg img').attr('src', e.target.result);
                        $('.sp-photo').addClass('cur');
                        html = html + '<div id="uploadList_' + i + '" class="upload_append_list"><p><span>' + file.name + '</span>' +
                            '<a href="javascript:" class="upload_delete" title="删除" data-index="' + i + '">删除</a>' +
                            '</div>';

                        i++;
                        funAppendImage();
                    }
                    reader.readAsDataURL(file);
                } else {
                    $("#preview").html(html);
                    if (html) {
                        //删除方法
                        $(".upload_delete").click(function () {
                            ZXXFILE.funDeleteFile(files[parseInt($(this).attr("data-index"))]);
                            $('.sp-photo').removeClass('cur').html('栏目图片');
                            return false;
                        });
                        //提交按钮显示
                        $("#fileSubmit").show();
                    } else {
                        //提交按钮隐藏
                        $("#fileSubmit").hide();
                    }
                }
            };
            funAppendImage();
        },
        onDelete: function (file) {
            $("#uploadList_" + file.index).fadeOut();
        },
        onDragOver: function () {
            $(this).addClass("upload_drag_hover");
        },
        onDragLeave: function () {
            $(this).removeClass("upload_drag_hover");
        },
        onProgress: function (file, loaded, total) {
            var eleProgress = $("#uploadProgress_" + file.index), percent = (loaded / total * 100).toFixed(2) + '%';
            eleProgress.show().html(percent);
        },
        onSuccess: function (file, response) {
            $("#uploadInf").append("<p>上传成功，图片地址是：" + response + "</p>");
        },
        onFailure: function (file) {
            $("#uploadInf").append("<p>图片" + file.name + "上传失败！</p>");
            $("#uploadImage_" + file.index).css("opacity", 0.2);
        },
        onComplete: function () {
            //提交按钮隐藏
            $("#fileSubmit").hide();
            //file控件value置空
            $("#fileImage").val("");
            $("#uploadInf").append("<p>当前图片全部上传完毕，可继续添加上传。</p>");
        }
    };
    ZXXFILE = $.extend(ZXXFILE, params);
    ZXXFILE.init();

</script>

</body>
</html>